package core.algorithms;

import java.io.Serializable;

import core.interfaces.IState;
import core.interfaces.IUtility;

public class SearchParameters<T> implements Serializable
{
	/**
	 * 
	 */
	private static final long serialVersionUID = -597576681102171654L;


	private final String TO_STRING_FORMAT = 
		"Max Heuristic Calls: %d\n" +
		"m_Heuristic: %s\n" +
		"m_Init State: %s\n";
	
	
	private int m_MaximumHeuristicCalls;
	IUtility<IState<T>, Double> m_Heuristic;
	private IState<T> m_InitialState;
	private int m_randomSteps;
	private int m_SpaceSeed;
	private int m_DrawLimit;
	private boolean m_BoundHeuristicCalls = true;
	private String m_InitialStateAsString;


	private int m_CourseNumber;
	
	@Override
	public SearchParameters<T> clone()
	{
		return commonUtils.SerialClone.clone(this);
	}
	
	@Override
	public String toString()
	{
		String retString = String.format(
				TO_STRING_FORMAT,
				m_MaximumHeuristicCalls,
				m_Heuristic.toString(),
				m_InitialState.getState());
		
		return retString;

	}
	
	public int getMaximumHeuristicCalls()
	{
		return m_MaximumHeuristicCalls;
	}
	public void setMaximumHeuristicCalls(int maximumHeuristicCalls)
	{
		m_MaximumHeuristicCalls = maximumHeuristicCalls;
	}
	public IUtility<IState<T>, Double> getHeuristic()
	{
		return m_Heuristic;
	}
	public void setHeuristic(IUtility<IState<T>, Double> heuristic)
	{
		m_Heuristic = heuristic;
	}
	public IState<T> getInitialState()
	{
		return m_InitialState;
	}
	public void setInitialState(IState<T> initialState)
	{
		m_InitialState = initialState;
		m_InitialStateAsString = m_InitialState.toString();
	}
	public int getRandomSteps()
	{
		return m_randomSteps;
	}
	public void setRandomSteps(int randomSteps) 
	{
		m_randomSteps = randomSteps;
	}
	public void setSpaceSeed(int m_SpaceSeed)
	{
		this.m_SpaceSeed = m_SpaceSeed;
	}
	public int getSpaceSeed()
	{
		return m_SpaceSeed;
	}
	public int getDrawLimit()
	{
		return m_DrawLimit;
	}
	public void setDrawLimit(int drawLimit)
	{
		this.m_DrawLimit = drawLimit; 
	}

	public void setBoundHeuristicCalls(boolean m_BoundHeuristicCalls)
	{
		this.m_BoundHeuristicCalls = m_BoundHeuristicCalls;
	}

	public boolean isBoundHeuristicCalls()
	{
		return m_BoundHeuristicCalls;
	}

	public void setInitialStateAsString(String initialStateAsString)
	{
		this.m_InitialStateAsString = initialStateAsString;
	}

	public String getInitialStateAsString()
	{
		return m_InitialStateAsString;
	}

	public int getCourseNumber()
	{
		return m_CourseNumber;
	}

	public void setCourseNumber(int numCourses)
	{
		m_CourseNumber = numCourses;
		
	}
	

	
}
